﻿/***********************************************************************
 * <copyright file="AuthRepository.cs" company="BUCA JSC">
 * -->    Copyright (C) statement. All right reserved
 * </copyright>
 * 
 * Created:   LinhMC
 * Email:    linhmc@buca.vn
 * Website:
 * Create Date: Friday, October 18, 2013
 * Usage: 
 * 
 * RevisionHistory: 
 * Date         Author               Description 
 * 
 * ************************************************************************/


using AOnlineService.Messages;
using BucaUIMvc.Repositories.Core;

namespace BucaUIMvc.Repositories
{
    /// <summary>
    /// Authentication Repository class.
    /// Note: this repository class is different from others (i.e. no CRUD operations) 
    /// and therefore does not need to implement IRepository<T/> (like all other repositories).
    /// </summary>
    public class AuthRepository : RepositoryBase
    {
        /// <summary>
        /// GetToken must be the first call into web service. 
        /// It establishes a session on the server and retrieves a newly created accesstoken.
        /// </summary>
        /// <returns>Unique access token that is valid for the duration of the session.</returns>
        public string GetToken()
        {
            var request = new TokenRequest {RequestId = RequestHelper.RequestId, ClientTag = RequestHelper.ClientTag};

         //   var response = Client.GetToken(request);

            Correlate(request, response);

         //   return response.AccessToken;
        }
    }
}